<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="myDiv" data-name="John" data-age="25">Hello, World!</div>
    <script>
        var div = document.getElementById('myDiv');  
let  name = div.dataset.name;   // "John"  
let  age = div.dataset.age;     // "25"  
console.log(name,age);//John 25
console.log ( div.dataset);//{name: 'John', age: '25'}



    </script>
</body>
</html>